<?php

if ( ! defined('EXT')) exit('Invalid file request');

/**
* Copee Pastee Helper Field Class
*/

  
class Iain_copee_pastee extends Fieldframe_Fieldtype {
    
    var $info = array(
    'name'             => 'Iain Copee Pastee',
    'version'          => '1.0.0',
    'desc'             => 'Outputs row count after your field name for copy/paste',
    'docs_url'         => '',
    'no_lang'  		   => TRUE,
    'versions_xml_url' => 'http://iain.co.nz/versions/copee-pastee.xml'
    );
    
  var $row_count = 0;


    
    var $default_cell_settings = array(
    'label' => 'images'
    );

    function display_cell_settings($cell_settings)
    {
        global $DSP, $LANG;
        $r  = '<label class="itemWrapper">'
        . $DSP->qdiv('defaultBold', 'Label:')
        . $DSP->input_text('label',(isset($cell_settings['label'])) ? $cell_settings['label'] : 'image', '20', '20','input', '80px')
        . '</label>';
        return $r;
    }
    
    
    function display_cell($cell_name, $cell_data, $cell_settings)
    {
        global $DSP, $FF;
        $count = $this->row_count++;
        $this->include_js('copee_functions.js');
        $this->include_css('copee_style.css');
        $r = $DSP->div('box row-counter');
        $r .= "<p>{".$cell_settings['label']."</p>";
        $r .= $DSP->div_c();
        $r .= $DSP->div('row-identifier');
        $r .= "<p>{".$cell_settings['label']."</p>";
        $r .= $DSP->div_c();
        return $r;
    }
    
}
?>